<template>
	<view class="uni-breadcrumb-x">
		<uni-breadcrumb separator="/">
			<uni-breadcrumb-item v-for="(route, index) in routes" :key="index" :to="route.to && route.to.path||''">
				{{route.name}}
			</uni-breadcrumb-item>
		</uni-breadcrumb>

		<!-- <el-select v-model="Type" placeholder="请选择">
			<el-option v-for="(item,index) in svData" :key="index" :value="item.name">
			</el-option>
		</el-select> -->
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		name: "uni-stat-breadcrumb",
		data() {
			return {
				// Type: "请选择服务器~",
				// data: {}
			};
		},
		methods: {
			/* test() {
				let arr = [...this.svData]
				arr.forEach(res => {
					if (this.besrurl == res.url) {
						this.Type = res.name
					}
				})
			},
			...mapMutations('http', ['setBesrUrl']) */
		},
		created() {
			// this.test()
		},
		watch: {
			// Type(val) {
			// 	let arr = [...this.svData]
			// 	arr.forEach(res => {
			// 		if (val == res.name) {
			// 			this.setBesrUrl(res.url)
			// 		}
			// 	})
			// }
		},
		computed: {
			...mapState('app', ['routes']),
			// ...mapState('http', ['besrurl','svData'])
		}
	}
</script>

<style lang="scss">
	.uni-breadcrumb-x{
		margin-top: 10px;
		margin-bottom: 10px;
	}
	/* page {
		width: 100%;
	}

	.uni-breadcrumb-x {
		width: 100%;
		flex: 1;
		display: flex;
		padding: 0 5px;
		min-height: 55px;
		line-height: 55px;
		align-items: center;

		.url-box {
			display: flex;
			justify-content: right;
			align-items: center;

			.url-box-item {
				display: inline-block;
				padding: 0px 5px;
				border: 1px solid #858585;
				text-align: center;
				height: 25px;
				line-height: 25px;
				box-sizing: border-box;
			}
		}
	} */
</style>
